#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace yoctolog_viewer {
	ref class LogMessageGroup;
	ref class SessionData;

	/// <summary>
	/// Summary for ylLogDataGridView
	/// </summary>
	public ref class LogDataGridView : public System::Windows::Forms::DataGridView
	{
	private:
		LogMessageGroup ^				m_pCurrentGroup;
		SessionData ^					m_pSessionData;

	public:
		LogDataGridView(void);

		void OnCellFormatting( Object^ /*sender*/, System::Windows::Forms::DataGridViewCellFormattingEventArgs^ e );
		void OnCellValueNeeded( Object^ /*sender*/, System::Windows::Forms::DataGridViewCellValueEventArgs^ e );

		void SetGroup(LogMessageGroup ^pGroup);
		LogMessageGroup ^GetMessageGroup() { return m_pCurrentGroup; }
		void SetSessionData(SessionData ^pSessionData);

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~LogDataGridView()
		{
			if (components)
			{
				delete components;
			}

			m_pCurrentGroup = nullptr;
		}

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
		}
#pragma endregion
	};
}
